import { Navigate } from 'react-router-dom'

const Daohang = (Com) => {
  return function(){
    let token = localStorage.getItem('token')
    if(token){
        return <Com/>
    }else{
        return <Navigate to="/login"/>
    }

  }
}

export default Daohang
